const state = {
  agent: '',
  os: '',
  version: '',
  device: '',
  menuButton: ''
}

const mutations = {
  SET_DEVICE: (state, data) => {
    state.device = data
  },
  SET_MENU_BUTTON: (state, data) => {
    state.menuButton = data
  }
}

const actions = {
  setDevice ({ commit }, data) {
    console.log('setDevice 每次调用？？？', data)
    commit('SET_DEVICE', data)
  },
  setMenuButton ({ commit }, data) {
    console.log('setMenuButton', data)
    commit('SET_MENU_BUTTON', data)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
